package com.yoo.ons.function.home

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.yoo.module_base.databinding.ItemCardBinding
import com.yoo.module_base.utils.log
import com.yoo.module_base.utils.setOnClickCallback
import com.yoo.module_base.view.CustomVerticalIndicator
import com.yoo.ons.adapter.HomeImageAdapter
import com.yoo.ons.base.adpater.AdapterCallback
import com.yoo.ons.databinding.LayoutRecyclerErrorBinding
import com.yoo.ons.model.HomeListModel
import com.yoo.ons.util.appContext
import com.youth.banner.config.IndicatorConfig
import com.youth.banner.util.BannerUtils

@SuppressLint("ClickableViewAccessibility")
class HomeErrorViewHolder(
    parent: ViewGroup,
    callback: AdapterCallback?,
    private val binding: LayoutRecyclerErrorBinding = LayoutRecyclerErrorBinding.inflate(
        LayoutInflater.from(parent.context),
        parent,
        false,
    )
) : RecyclerView.ViewHolder(binding.root) {

    init {
        binding.errorTryAgain.setOnClickCallback {
            //点击try again
            callback?.invoke(HOME_CARD_ERROR_TRY_AGAIN_CLICK, itemView)
        }
    }
}